
InsClassMap = {
'Arithmetic Operations' : 'ScalarArith',
'Absolute Value Operations' : 'ScalarAbs',
'Move Operations' : 'ScalarMov',
'Compare and Select Operations' : 'ScalarCmp',
'Bit-Wise Logic Operations' : 'ScalarBitLogic',
'Bit Manipulation Operations' : 'ScalarBitManip',
'Bit-Field Operations' : 'ScalarBitField',
'Conversion Operations' : 'ScalarConv',
'EXEC Mask Operations' : 'ScalarExecMask',
'Quad Mask Operations' : 'ScalarQuadMask',
'Register Move' : 'VectorRegMov',
'Vector Lane Access' : 'VectorLane',
'Bitwise Logical Operations' : 'VectorBitLogic',
'32-bit Shift, Rotate, and Bitfield Access Operations' : 'VectorBitField32',
'32-bit Thread Mask Operations' : 'VectorThreadMask',
'64-bit Shift and Rotate Operations' : 'VectorBitField64',
'32-bit Floating Point Arithmetic' : 'VectorFpArith32',
'32-bit Floating Point Rounding' : 'VectorFpRound32',
'32-bit Floating Point Field Access' : 'VectorFpField32',
'32-bit Floating Point Transcendental' : 'VectorFpTran32',
'32-bit Floating Point Comparison' : 'VectorFpCmp32',
'64-bit Double Floating Point Arithmetic' : 'VectorFpArith64',
'64-bit Double Floating Point Rounding' : 'VectorFpRound64',
'64-bit Double Floating Point Field Access' : 'VectorFpField64',
'64-bit Double Floating Point Transcendental' : 'VectorFpTran64',
'64-bit Double Floating Point Comparison' : 'VectorFpCmp64',
'32-bit Integer Arithmetic' : 'VectorIntArith32',
'64-bit Integer Arithmetic' : 'VectorIntArith64',
'32-bit Integer Comparison' : 'VectorIntCmp32',
'64-bit Integer Comparison' : 'VectorIntCmp64',
'Conversion Operations' : 'VectorConv',
'32-bit Floating Point Graphics Operations' : 'VectorFpGraph32',
'Integer Graphics Operations' : 'VectorIntGraph',
'Miscellaneous' : 'VectorMisc',
'Program Flow' : 'ScalarProgFlow',
'Synchronization' : 'ScalarSync',
'Wait Operations' : 'ScalarWait',
'Instruction Cache Control' : 'ScalarCache',
'Wavefront Priority Control' : 'ScalarPrior',
'Register Access' : 'ScalarRegAccess',
'Messages' : 'ScalarMsg',
'Scalar Memory Read Operations' : 'ScalarMemRd',
'Scalar Memory Utility Operations' : 'ScalarMemUt',
'Buffer Access without Format Conversion' : 'VectorMemBufNoFmt',
'Buffer Access with Format Conversion' : 'VectorMemBufFmt',
'Image Access without Sampling' : 'VectorMemImgNoSmp',
'Image Access with Sampling' : 'VectorMemImgSmp',
'Image Utility' : 'VectorMemImgUt',
'L1 Data Cache Control' : 'VectorMemL1Cache',
'Indexed Read Operations' : 'DsIdxRd',
'Indexed Write Operations' : 'DsIdxWr',
'Indexed Write Exchange Operations' : 'DsIdxWrXchg',
'Indexed Conditional Exchange Operations' : 'DsIdxCondXchg',
'Indexed Wrap Operations' : 'DsIdxWrap',
'32 bit Atomic Arithmetic Operations' : 'DsAtomicArith32',
'64 bit Atomic Arithmetic Operations' : 'DsAtomicArith64',
'32 bit Atomic Min/Max Operations' : 'DsAtomicMinMax32',
'64 bit Atomic Min/Max Operations' : 'DsAtomicMinMax64',
'32 bit Atomic Compare-Store Operations' : 'DsAtomicCmpSt32',
'64 bit Atomic Compare-Store Operations' : 'DsAtomicCmpSt64',
'32 bit Atomic Logic Operations' : 'DsAtomicLogic32',
'64 bit Atomic Logic Operations' : 'DsAtomicLogic64',
'Append and Consume Operations' : 'DsAppendCon',
'Data Share Utility Operations' : 'DsDataShareUt',
'Data Share Miscellaneous Operations' : 'DsDataShareMisc',
'Global Wave Sync Operations' : 'GdsSync',
'Ordered Count Operations' : 'GdsOrdCnt',
'32-bit Floating Point Parameter Cache Interpolation' : 'VectorInterpFpCache',
'Export' : 'Exp',
'Profiling' : 'DbgProf'
}

InsList = [
'S_MOV_B32',
'S_MOV_B64',
'S_CMOV_B32',
'S_CMOV_B64',
'S_NOT_B32',
'S_NOT_B64',
'S_WQM_B32',
'S_WQM_B64',
'S_BREV_B32',
'S_BREV_B64',
'S_BCNT0_I32_B32',
'S_BCNT0_I32_B64',
'S_BCNT1_I32_B32',
'S_BCNT1_I32_B64',
'S_FF0_I32_B32',
'S_FF0_I32_B64',
'S_FF1_I32_B32',
'S_FF1_I32_B64',
'S_FLBIT_I32_B32',
'S_FLBIT_I32_B64',
'S_FLBIT_I32',
'S_FLBIT_I32_I64',
'S_SEXT_I32_I8',
'S_SEXT_I32_I16',
'S_BITSET0_B32',
'S_BITSET0_B64',
'S_BITSET1_B32',
'S_BITSET1_B64',
'S_GETPC_B64',
'S_SETPC_B64',
'S_SWAPPC_B64',
'S_RFE_B64',
'S_AND_SAVEEXEC_B64',
'S_OR_SAVEEXEC_B64',
'S_XOR_SAVEEXEC_B64',
'S_ANDN2_SAVEEXEC_B64',
'S_ORN2_SAVEEXEC_B64',
'S_NAND_SAVEEXEC_B64',
'S_NOR_SAVEEXEC_B64',
'S_XNOR_SAVEEXEC_B64',
'S_QUADMASK_B32',
'S_QUADMASK_B64',
'S_MOVRELS_B32',
'S_MOVRELS_B64',
'S_MOVRELD_B32',
'S_MOVRELD_B64',
'S_CBRANCH_JOIN',
'S_ABS_I32',
'S_MOV_FED_B32',
'S_ADD_U32',
'S_SUB_U32',
'S_ADD_I32',
'S_SUB_I32',
'S_ADDC_U32',
'S_SUBB_U32',
'S_MIN_I32',
'S_MIN_U32',
'S_MAX_I32',
'S_MAX_U32',
'S_CSELECT_B32',
'S_CSELECT_B64',
'S_AND_B32',
'S_AND_B64',
'S_OR_B32',
'S_OR_B64',
'S_XOR_B32',
'S_XOR_B64',
'S_ANDN2_B32',
'S_ANDN2_B64',
'S_ORN2_B32',
'S_ORN2_B64',
'S_NAND_B32',
'S_NAND_B64',
'S_NOR_B32',
'S_NOR_B64',
'S_XNOR_B32',
'S_XNOR_B64',
'S_LSHL_B32',
'S_LSHL_B64',
'S_LSHR_B32',
'S_LSHR_B64',
'S_ASHR_I32',
'S_ASHR_I64',
'S_BFM_B32',
'S_BFM_B64',
'S_MUL_I32',
'S_BFE_U32',
'S_BFE_I32',
'S_BFE_U64',
'S_BFE_I64',
'S_CBRANCH_G_FORK',
'S_ABSDIFF_I32',
'S_CMP_EQ_I32',
'S_CMP_LG_I32',
'S_CMP_GT_I32',
'S_CMP_GE_I32',
'S_CMP_LT_I32',
'S_CMP_LE_I32',
'S_CMP_EQ_U32',
'S_CMP_LG_U32',
'S_CMP_GT_U32',
'S_CMP_GE_U32',
'S_CMP_LT_U32',
'S_CMP_LE_U32',
'S_BITCMP0_B32',
'S_BITCMP1_B32',
'S_BITCMP0_B64',
'S_BITCMP1_B64',
'S_SETVSKIP',
'S_MOVK_I32',
'S_CMOVK_I32',
'S_CMPK_EQ_I32',
'S_CMPK_LG_I32',
'S_CMPK_GT_I32',
'S_CMPK_GE_I32',
'S_CMPK_LT_I32',
'S_CMPK_LE_I32',
'S_CMPK_EQ_U32',
'S_CMPK_LG_U32',
'S_CMPK_GT_U32',
'S_CMPK_GE_U32',
'S_CMPK_LT_U32',
'S_CMPK_LE_U32',
'S_ADDK_I32',
'S_MULK_I32',
'S_CBRANCH_I_FORK',
'S_GETREG_B32',
'S_SETREG_B32',
'S_SETREG_IMM32_B32',
'S_NOP',
'S_ENDPGM',
'S_BRANCH',
'S_CBRANCH_SCC0',
'S_CBRANCH_SCC1',
'S_CBRANCH_VCCZ',
'S_CBRANCH_VCCNZ',
'S_CBRANCH_EXECZ',
'S_CBRANCH_EXECNZ',
'S_BARRIER',
'S_WAITCNT',
'S_SETHALT',
'S_SLEEP',
'S_SETPRIO',
'S_SENDMSG',
'S_SENDMSGHALT',
'S_TRAP',
'S_ICACHE_INV',
'S_INCPERFLEVEL',
'S_DECPERFLEVEL',
'S_TTRACEDATA',
'S_CBRANCH_CDBGSYS',
'S_CBRANCH_CDBGUSER',
'S_CBRANCH_CDBGSYS_OR_USER',
'S_CBRANCH_CDBGSYS_AND_USER',
'V_NOP',
'V_MOV_B32',
'V_READFIRSTLANE_B32',
'V_CVT_I32_F64',
'V_CVT_F64_I32',
'V_CVT_F32_I32',
'V_CVT_F32_U32',
'V_CVT_U32_F32',
'V_CVT_I32_F32',
'V_MOV_FED_B32',
'V_CVT_F16_F32',
'V_CVT_F32_F16',
'V_CVT_RPI_I32_F32',
'V_CVT_FLR_I32_F32',
'V_CVT_OFF_F32_I4',
'V_CVT_F32_F64',
'V_CVT_F64_F32',
'V_CVT_F32_UBYTE0',
'V_CVT_F32_UBYTE1',
'V_CVT_F32_UBYTE2',
'V_CVT_F32_UBYTE3',
'V_CVT_U32_F64',
'V_CVT_F64_U32',
'V_FRACT_F32',
'V_TRUNC_F32',
'V_CEIL_F32',
'V_RNDNE_F32',
'V_FLOOR_F32',
'V_EXP_F32',
'V_LOG_CLAMP_F32',
'V_LOG_F32',
'V_RCP_CLAMP_F32',
'V_RCP_LEGACY_F32',
'V_RCP_F32',
'V_RCP_IFLAG_F32',
'V_RSQ_CLAMP_F32',
'V_RSQ_LEGACY_F32',
'V_RSQ_F32',
'V_RCP_F64',
'V_RCP_CLAMP_F64',
'V_RSQ_F64',
'V_RSQ_CLAMP_F64',
'V_SQRT_F32',
'V_SQRT_F64',
'V_SIN_F32',
'V_COS_F32',
'V_NOT_B32',
'V_BFREV_B32',
'V_FFBH_U32',
'V_FFBL_B32',
'V_FFBH_I32',
'V_FREXP_EXP_I32_F64',
'V_FREXP_MANT_F64',
'V_FRACT_F64',
'V_FREXP_EXP_I32_F32',
'V_FREXP_MANT_F32',
'V_CLREXCP',
'V_MOVRELD_B32',
'V_MOVRELS_B32',
'V_MOVRELSD_B32',
'VOP1_UNDEFINE',
'V_CNDMASK_B32',
'V_READLANE_B32',
'V_WRITELANE_B32',
'V_ADD_F32',
'V_SUB_F32',
'V_SUBREV_F32',
'V_MAC_LEGACY_F32',
'V_MUL_LEGACY_F32',
'V_MUL_F32',
'V_MUL_I32_I24',
'V_MUL_HI_I32_I24',
'V_MUL_U32_U24',
'V_MUL_HI_U32_U24',
'V_MIN_LEGACY_F32',
'V_MAX_LEGACY_F32',
'V_MIN_F32',
'V_MAX_F32',
'V_MIN_I32',
'V_MAX_I32',
'V_MIN_U32',
'V_MAX_U32',
'V_LSHR_B32',
'V_LSHRREV_B32',
'V_ASHR_I32',
'V_ASHRREV_I32',
'V_LSHL_B32',
'V_LSHLREV_B32',
'V_AND_B32',
'V_OR_B32',
'V_XOR_B32',
'V_BFM_B32',
'V_MAC_F32',
'V_MADMK_F32',
'V_MADAK_F32',
'V_BCNT_U32_B32',
'V_MBCNT_LO_U32_B32',
'V_MBCNT_HI_U32_B32',
'V_ADD_I32',
'V_SUB_I32',
'V_SUBREV_I32',
'V_ADDC_U32',
'V_SUBB_U32',
'V_SUBBREV_U32',
'V_LDEXP_F32',
'V_CVT_PKACCUM_U8_F32',
'V_CVT_PKNORM_I16_F32',
'V_CVT_PKNORM_U16_F32',
'V_CVT_PKRTZ_F16_F32',
'V_CVT_PK_U16_U32',
'V_CVT_PK_I16_I32',
'VOP2_UNDEFINE',
'V3_CMP_F_F32',
'V3_CMP_LT_F32',
'V3_CMP_EQ_F32',
'V3_CMP_LE_F32',
'V3_CMP_GT_F32',
'V3_CMP_LG_F32',
'V3_CMP_GE_F32',
'V3_CMP_O_F32',
'V3_CMP_U_F32',
'V3_CMP_NGE_F32',
'V3_CMP_NLG_F32',
'V3_CMP_NGT_F32',
'V3_CMP_NLE_F32',
'V3_CMP_NEQ_F32',
'V3_CMP_NLT_F32',
'V3_CMP_TRU_F32',
'V3_CMPX_F_F32',
'V3_CMPX_LT_F32',
'V3_CMPX_EQ_F32',
'V3_CMPX_LE_F32',
'V3_CMPX_GT_F32',
'V3_CMPX_LG_F32',
'V3_CMPX_GE_F32',
'V3_CMPX_O_F32',
'V3_CMPX_U_F32',
'V3_CMPX_NGE_F32',
'V3_CMPX_NLG_F32',
'V3_CMPX_NGT_F32',
'V3_CMPX_NLE_F32',
'V3_CMPX_NEQ_F32',
'V3_CMPX_NLT_F32',
'V3_CMPX_TRU_F32',
'V3_CMP_F_F64',
'V3_CMP_LT_F64',
'V3_CMP_EQ_F64',
'V3_CMP_LE_F64',
'V3_CMP_GT_F64',
'V3_CMP_LG_F64',
'V3_CMP_GE_F64',
'V3_CMP_O_F64',
'V3_CMP_U_F64',
'V3_CMP_NGE_F64',
'V3_CMP_NLG_F64',
'V3_CMP_NGT_F64',
'V3_CMP_NLE_F64',
'V3_CMP_NEQ_F64',
'V3_CMP_NLT_F64',
'V3_CMP_TRU_F64',
'V3_CMPX_F_F64',
'V3_CMPX_LT_F64',
'V3_CMPX_EQ_F64',
'V3_CMPX_LE_F64',
'V3_CMPX_GT_F64',
'V3_CMPX_LG_F64',
'V3_CMPX_GE_F64',
'V3_CMPX_O_F64',
'V3_CMPX_U_F64',
'V3_CMPX_NGE_F64',
'V3_CMPX_NLG_F64',
'V3_CMPX_NGT_F64',
'V3_CMPX_NLE_F64',
'V3_CMPX_NEQ_F64',
'V3_CMPX_NLT_F64',
'V3_CMPX_TRU_F64',
'V3_CMPS_F_F32',
'V3_CMPS_LT_F32',
'V3_CMPS_EQ_F32',
'V3_CMPS_LE_F32',
'V3_CMPS_GT_F32',
'V3_CMPS_LG_F32',
'V3_CMPS_GE_F32',
'V3_CMPS_O_F32',
'V3_CMPS_U_F32',
'V3_CMPS_NGE_F32',
'V3_CMPS_NLG_F32',
'V3_CMPS_NGT_F32',
'V3_CMPS_NLE_F32',
'V3_CMPS_NEQ_F32',
'V3_CMPS_NLT_F32',
'V3_CMPS_TRU_F32',
'V3_CMPSX_F_F32',
'V3_CMPSX_LT_F32',
'V3_CMPSX_EQ_F32',
'V3_CMPSX_LE_F32',
'V3_CMPSX_GT_F32',
'V3_CMPSX_LG_F32',
'V3_CMPSX_GE_F32',
'V3_CMPSX_O_F32',
'V3_CMPSX_U_F32',
'V3_CMPSX_NGE_F32',
'V3_CMPSX_NLG_F32',
'V3_CMPSX_NGT_F32',
'V3_CMPSX_NLE_F32',
'V3_CMPSX_NEQ_F32',
'V3_CMPSX_NLT_F32',
'V3_CMPSX_TRU_F32',
'V3_CMPS_F_F64',
'V3_CMPS_LT_F64',
'V3_CMPS_EQ_F64',
'V3_CMPS_LE_F64',
'V3_CMPS_GT_F64',
'V3_CMPS_LG_F64',
'V3_CMPS_GE_F64',
'V3_CMPS_O_F64',
'V3_CMPS_U_F64',
'V3_CMPS_NGE_F64',
'V3_CMPS_NLG_F64',
'V3_CMPS_NGT_F64',
'V3_CMPS_NLE_F64',
'V3_CMPS_NEQ_F64',
'V3_CMPS_NLT_F64',
'V3_CMPS_TRU_F64',
'V3_CMPSX_F_F64',
'V3_CMPSX_LT_F64',
'V3_CMPSX_EQ_F64',
'V3_CMPSX_LE_F64',
'V3_CMPSX_GT_F64',
'V3_CMPSX_LG_F64',
'V3_CMPSX_GE_F64',
'V3_CMPSX_O_F64',
'V3_CMPSX_U_F64',
'V3_CMPSX_NGE_F64',
'V3_CMPSX_NLG_F64',
'V3_CMPSX_NGT_F64',
'V3_CMPSX_NLE_F64',
'V3_CMPSX_NEQ_F64',
'V3_CMPSX_NLT_F64',
'V3_CMPSX_TRU_F64',
'V3_CMP_F_I32',
'V3_CMP_LT_I32',
'V3_CMP_EQ_I32',
'V3_CMP_LE_I32',
'V3_CMP_GT_I32',
'V3_CMP_NE_I32',
'V3_CMP_GE_I32',
'V3_CMP_T_I32',
'V3_CMP_CLASS_F32',
'V3_CMP_LT_I16',
'V3_CMP_EQ_I16',
'V3_CMP_LE_I16',
'V3_CMP_GT_I16',
'V3_CMP_NE_I16',
'V3_CMP_GE_I16',
'V3_CMP_CLASS_F16',
'V3_CMPX_F_I32',
'V3_CMPX_LT_I32',
'V3_CMPX_EQ_I32',
'V3_CMPX_LE_I32',
'V3_CMPX_GT_I32',
'V3_CMPX_NE_I32',
'V3_CMPX_GE_I32',
'V3_CMPX_T_I32',
'V3_CMPX_CLASS_F32',
'V3_CMPX_LT_I16',
'V3_CMPX_EQ_I16',
'V3_CMPX_LE_I16',
'V3_CMPX_GT_I16',
'V3_CMPX_NE_I16',
'V3_CMPX_GE_I16',
'V3_CMPX_CLASS_F16',
'V3_CMP_F_I64',
'V3_CMP_LT_I64',
'V3_CMP_EQ_I64',
'V3_CMP_LE_I64',
'V3_CMP_GT_I64',
'V3_CMP_NE_I64',
'V3_CMP_GE_I64',
'V3_CMP_T_I64',
'V3_CMP_CLASS_F64',
'V3_CMP_LT_U16',
'V3_CMP_EQ_U16',
'V3_CMP_LE_U16',
'V3_CMP_GT_U16',
'V3_CMP_NE_U16',
'V3_CMP_GE_U16',
'V3_CMPX_F_I64',
'V3_CMPX_LT_I64',
'V3_CMPX_EQ_I64',
'V3_CMPX_LE_I64',
'V3_CMPX_GT_I64',
'V3_CMPX_NE_I64',
'V3_CMPX_GE_I64',
'V3_CMPX_T_I64',
'V3_CMPX_CLASS_F64',
'V3_CMPX_LT_U16',
'V3_CMPX_EQ_U16',
'V3_CMPX_LE_U16',
'V3_CMPX_GT_U16',
'V3_CMPX_NE_U16',
'V3_CMPX_GE_U16',
'V3_CMP_F_U32',
'V3_CMP_LT_U32',
'V3_CMP_EQ_U32',
'V3_CMP_LE_U32',
'V3_CMP_GT_U32',
'V3_CMP_NE_U32',
'V3_CMP_GE_U32',
'V3_CMP_T_U32',
'V3_CMP_F_F16',
'V3_CMP_LT_F16',
'V3_CMP_EQ_F16',
'V3_CMP_LE_F16',
'V3_CMP_GT_F16',
'V3_CMP_LG_F16',
'V3_CMP_GE_F16',
'V3_CMP_O_F16',
'V3_CMPX_F_U32',
'V3_CMPX_LT_U32',
'V3_CMPX_EQ_U32',
'V3_CMPX_LE_U32',
'V3_CMPX_GT_U32',
'V3_CMPX_NE_U32',
'V3_CMPX_GE_U32',
'V3_CMPX_T_U32',
'V3_CMPX_F_F16',
'V3_CMPX_LT_F16',
'V3_CMPX_EQ_F16',
'V3_CMPX_LE_F16',
'V3_CMPX_GT_F16',
'V3_CMPX_LG_F16',
'V3_CMPX_GE_F16',
'V3_CMPX_O_F16',
'V3_CMP_F_U64',
'V3_CMP_LT_U64',
'V3_CMP_EQ_U64',
'V3_CMP_LE_U64',
'V3_CMP_GT_U64',
'V3_CMP_NE_U64',
'V3_CMP_GE_U64',
'V3_CMP_T_U64',
'V3_CMP_U_F16',
'V3_CMP_NGE_F16',
'V3_CMP_NLG_F16',
'V3_CMP_NGT_F16',
'V3_CMP_NLE_F16',
'V3_CMP_NEQ_F16',
'V3_CMP_NLT_F16',
'V3_CMP_TRU_F16',
'V3_CMPX_F_U64',
'V3_CMPX_LT_U64',
'V3_CMPX_EQ_U64',
'V3_CMPX_LE_U64',
'V3_CMPX_GT_U64',
'V3_CMPX_NE_U64',
'V3_CMPX_GE_U64',
'V3_CMPX_T_U64',
'V3_CNDMASK_B32',
'V3_READLANE_B32',
'V3_WRITELANE_B32',
'V3_ADD_F32',
'V3_SUB_F32',
'V3_SUBREV_F32',
'V3_MAC_LEGACY_F32',
'V3_MUL_LEGACY_F32',
'V3_MUL_F32',
'V3_MUL_I32_I24',
'V3_MUL_HI_I32_I24',
'V3_MUL_U32_U24',
'V3_MUL_HI_U32_U24',
'V3_MIN_LEGACY_F32',
'V3_MAX_LEGACY_F32',
'V3_MIN_F32',
'V3_MAX_F32',
'V3_MIN_I32',
'V3_MAX_I32',
'V3_MIN_U32',
'V3_MAX_U32',
'V3_LSHR_B32',
'V3_LSHRREV_B32',
'V3_ASHR_I32',
'V3_ASHRREV_I32',
'V3_LSHL_B32',
'V3_LSHLREV_B32',
'V3_AND_B32',
'V3_OR_B32',
'V3_XOR_B32',
'V3_BFM_B32',
'V3_MAC_F32',
'V3_MADMK_F32',
'V3_MADAK_F32',
'V3_BCNT_U32_B32',
'V3_MBCNT_LO_U32_B32',
'V3_MBCNT_HI_U32_B32',
'V3_ADD_I32',
'V3_SUB_I32',
'V3_SUBREV_I32',
'V3_ADDC_U32',
'V3_SUBB_U32',
'V3_SUBBREV_U32',
'V3_LDEXP_F32',
'V3_CVT_PKACCUM_U8_F32',
'V3_CVT_PKNORM_I16_F32',
'V3_CVT_PKNORM_U16_F32',
'V3_CVT_PKRTZ_F16_F32',
'V3_CVT_PK_U16_U32',
'V3_CVT_PK_I16_I32',
'V3_MAD_LEGACY_F32',
'V3_MAD_F32',
'V3_MAD_I32_I24',
'V3_MAD_U32_U24',
'V3_CUBEID_F32',
'V3_CUBESC_F32',
'V3_CUBETC_F32',
'V3_CUBEMA_F32',
'V3_BFE_U32',
'V3_BFE_I32',
'V3_BFI_B32',
'V3_FMA_F32',
'V3_FMA_F64',
'V3_LERP_U8',
'V3_ALIGNBIT_B32',
'V3_ALIGNBYTE_B32',
'V3_MULLIT_F32',
'V3_MIN3_F32',
'V3_MIN3_I32',
'V3_MIN3_U32',
'V3_MAX3_F32',
'V3_MAX3_I32',
'V3_MAX3_U32',
'V3_MED3_F32',
'V3_MED3_I32',
'V3_MED3_U32',
'V3_SAD_U8',
'V3_SAD_HI_U8',
'V3_SAD_U16',
'V3_SAD_U32',
'V3_CVT_PK_U8_F32',
'V3_DIV_FIXUP_F32',
'V3_DIV_FIXUP_F64',
'V3_LSHL_B64',
'V3_LSHR_B64',
'V3_ASHR_I64',
'V3_ADD_F64',
'V3_MUL_F64',
'V3_MIN_F64',
'V3_MAX_F64',
'V3_LDEXP_F64',
'V3_MUL_LO_U32',
'V3_MUL_HI_U32',
'V3_MUL_LO_I32',
'V3_MUL_HI_I32',
'V3_DIV_SCALE_F32',
'V3_DIV_SCALE_F64',
'V3_DIV_FMAS_F32',
'V3_DIV_FMAS_F64',
'V3_MSAD_U8',
'V3_QSAD_U8',
'V3_MQSAD_U8',
'V3_TRIG_PREOP_F64',
'V3_NOP',
'V3_MOV_B32',
'V3_READFIRSTLANE_B32',
'V3_CVT_I32_F64',
'V3_CVT_F64_I32',
'V3_CVT_F32_I32',
'V3_CVT_F32_U32',
'V3_CVT_U32_F32',
'V3_CVT_I32_F32',
'V3_MOV_FED_B32',
'V3_CVT_F16_F32',
'V3_CVT_F32_F16',
'V3_CVT_RPI_I32_F32',
'V3_CVT_FLR_I32_F32',
'V3_CVT_OFF_F32_I4',
'V3_CVT_F32_F64',
'V3_CVT_F64_F32',
'V3_CVT_F32_UBYTE0',
'V3_CVT_F32_UBYTE1',
'V3_CVT_F32_UBYTE2',
'V3_CVT_F32_UBYTE3',
'V3_CVT_U32_F64',
'V3_CVT_F64_U32',
'V3_FRACT_F32',
'V3_TRUNC_F32',
'V3_CEIL_F32',
'V3_RNDNE_F32',
'V3_FLOOR_F32',
'V3_EXP_F32',
'V3_LOG_CLAMP_F32',
'V3_LOG_F32',
'V3_RCP_CLAMP_F32',
'V3_RCP_LEGACY_F32',
'V3_RCP_F32',
'V3_RCP_IFLAG_F32',
'V3_RSQ_CLAMP_F32',
'V3_RSQ_LEGACY_F32',
'V3_RSQ_F32',
'V3_RCP_F64',
'V3_RCP_CLAMP_F64',
'V3_RSQ_F64',
'V3_RSQ_CLAMP_F64',
'V3_SQRT_F32',
'V3_SQRT_F64',
'V3_SIN_F32',
'V3_COS_F32',
'V3_NOT_B32',
'V3_BFREV_B32',
'V3_FFBH_U32',
'V3_FFBL_B32',
'V3_FFBH_I32',
'V3_FREXP_EXP_I32_F64',
'V3_FREXP_MANT_F64',
'V3_FRACT_F64',
'V3_FREXP_EXP_I32_F32',
'V3_FREXP_MANT_F32',
'V3_CLREXCP',
'V3_MOVRELD_B32',
'V3_MOVRELS_B32',
'V3_MOVRELSD_B32',
'VOP3_UNDEFINE',
'V_CMP_F_F32',
'V_CMP_LT_F32',
'V_CMP_EQ_F32',
'V_CMP_LE_F32',
'V_CMP_GT_F32',
'V_CMP_LG_F32',
'V_CMP_GE_F32',
'V_CMP_O_F32',
'V_CMP_U_F32',
'V_CMP_NGE_F32',
'V_CMP_NLG_F32',
'V_CMP_NGT_F32',
'V_CMP_NLE_F32',
'V_CMP_NEQ_F32',
'V_CMP_NLT_F32',
'V_CMP_TRU_F32',
'V_CMPX_F_F32',
'V_CMPX_LT_F32',
'V_CMPX_EQ_F32',
'V_CMPX_LE_F32',
'V_CMPX_GT_F32',
'V_CMPX_LG_F32',
'V_CMPX_GE_F32',
'V_CMPX_O_F32',
'V_CMPX_U_F32',
'V_CMPX_NGE_F32',
'V_CMPX_NLG_F32',
'V_CMPX_NGT_F32',
'V_CMPX_NLE_F32',
'V_CMPX_NEQ_F32',
'V_CMPX_NLT_F32',
'V_CMPX_TRU_F32',
'V_CMP_F_F64',
'V_CMP_LT_F64',
'V_CMP_EQ_F64',
'V_CMP_LE_F64',
'V_CMP_GT_F64',
'V_CMP_LG_F64',
'V_CMP_GE_F64',
'V_CMP_O_F64',
'V_CMP_U_F64',
'V_CMP_NGE_F64',
'V_CMP_NLG_F64',
'V_CMP_NGT_F64',
'V_CMP_NLE_F64',
'V_CMP_NEQ_F64',
'V_CMP_NLT_F64',
'V_CMP_TRU_F64',
'V_CMPX_F_F64',
'V_CMPX_LT_F64',
'V_CMPX_EQ_F64',
'V_CMPX_LE_F64',
'V_CMPX_GT_F64',
'V_CMPX_LG_F64',
'V_CMPX_GE_F64',
'V_CMPX_O_F64',
'V_CMPX_U_F64',
'V_CMPX_NGE_F64',
'V_CMPX_NLG_F64',
'V_CMPX_NGT_F64',
'V_CMPX_NLE_F64',
'V_CMPX_NEQ_F64',
'V_CMPX_NLT_F64',
'V_CMPX_TRU_F64',
'V_CMPS_F_F32',
'V_CMPS_LT_F32',
'V_CMPS_EQ_F32',
'V_CMPS_LE_F32',
'V_CMPS_GT_F32',
'V_CMPS_LG_F32',
'V_CMPS_GE_F32',
'V_CMPS_O_F32',
'V_CMPS_U_F32',
'V_CMPS_NGE_F32',
'V_CMPS_NLG_F32',
'V_CMPS_NGT_F32',
'V_CMPS_NLE_F32',
'V_CMPS_NEQ_F32',
'V_CMPS_NLT_F32',
'V_CMPS_TRU_F32',
'V_CMPSX_F_F32',
'V_CMPSX_LT_F32',
'V_CMPSX_EQ_F32',
'V_CMPSX_LE_F32',
'V_CMPSX_GT_F32',
'V_CMPSX_LG_F32',
'V_CMPSX_GE_F32',
'V_CMPSX_O_F32',
'V_CMPSX_U_F32',
'V_CMPSX_NGE_F32',
'V_CMPSX_NLG_F32',
'V_CMPSX_NGT_F32',
'V_CMPSX_NLE_F32',
'V_CMPSX_NEQ_F32',
'V_CMPSX_NLT_F32',
'V_CMPSX_TRU_F32',
'V_CMPS_F_F64',
'V_CMPS_LT_F64',
'V_CMPS_EQ_F64',
'V_CMPS_LE_F64',
'V_CMPS_GT_F64',
'V_CMPS_LG_F64',
'V_CMPS_GE_F64',
'V_CMPS_O_F64',
'V_CMPS_U_F64',
'V_CMPS_NGE_F64',
'V_CMPS_NLG_F64',
'V_CMPS_NGT_F64',
'V_CMPS_NLE_F64',
'V_CMPS_NEQ_F64',
'V_CMPS_NLT_F64',
'V_CMPS_TRU_F64',
'V_CMPSX_F_F64',
'V_CMPSX_LT_F64',
'V_CMPSX_EQ_F64',
'V_CMPSX_LE_F64',
'V_CMPSX_GT_F64',
'V_CMPSX_LG_F64',
'V_CMPSX_GE_F64',
'V_CMPSX_O_F64',
'V_CMPSX_U_F64',
'V_CMPSX_NGE_F64',
'V_CMPSX_NLG_F64',
'V_CMPSX_NGT_F64',
'V_CMPSX_NLE_F64',
'V_CMPSX_NEQ_F64',
'V_CMPSX_NLT_F64',
'V_CMPSX_TRU_F64',
'V_CMP_F_I32',
'V_CMP_LT_I32',
'V_CMP_EQ_I32',
'V_CMP_LE_I32',
'V_CMP_GT_I32',
'V_CMP_NE_I32',
'V_CMP_GE_I32',
'V_CMP_T_I32',
'V_CMP_CLASS_F32',
'V_CMP_LT_I16',
'V_CMP_EQ_I16',
'V_CMP_LE_I16',
'V_CMP_GT_I16',
'V_CMP_NE_I16',
'V_CMP_GE_I16',
'V_CMP_CLASS_F16',
'V_CMPX_F_I32',
'V_CMPX_LT_I32',
'V_CMPX_EQ_I32',
'V_CMPX_LE_I32',
'V_CMPX_GT_I32',
'V_CMPX_NE_I32',
'V_CMPX_GE_I32',
'V_CMPX_T_I32',
'V_CMPX_CLASS_F32',
'V_CMPX_LT_I16',
'V_CMPX_EQ_I16',
'V_CMPX_LE_I16',
'V_CMPX_GT_I16',
'V_CMPX_NE_I16',
'V_CMPX_GE_I16',
'V_CMPX_CLASS_F16',
'V_CMP_F_I64',
'V_CMP_LT_I64',
'V_CMP_EQ_I64',
'V_CMP_LE_I64',
'V_CMP_GT_I64',
'V_CMP_NE_I64',
'V_CMP_GE_I64',
'V_CMP_T_I64',
'V_CMP_CLASS_F64',
'V_CMP_LT_U16',
'V_CMP_EQ_U16',
'V_CMP_LE_U16',
'V_CMP_GT_U16',
'V_CMP_NE_U16',
'V_CMP_GE_U16',
'V_CMPX_F_I64',
'V_CMPX_LT_I64',
'V_CMPX_EQ_I64',
'V_CMPX_LE_I64',
'V_CMPX_GT_I64',
'V_CMPX_NE_I64',
'V_CMPX_GE_I64',
'V_CMPX_T_I64',
'V_CMPX_CLASS_F64',
'V_CMPX_LT_U16',
'V_CMPX_EQ_U16',
'V_CMPX_LE_U16',
'V_CMPX_GT_U16',
'V_CMPX_NE_U16',
'V_CMPX_GE_U16',
'V_CMP_F_U32',
'V_CMP_LT_U32',
'V_CMP_EQ_U32',
'V_CMP_LE_U32',
'V_CMP_GT_U32',
'V_CMP_NE_U32',
'V_CMP_GE_U32',
'V_CMP_T_U32',
'V_CMP_F_F16',
'V_CMP_LT_F16',
'V_CMP_EQ_F16',
'V_CMP_LE_F16',
'V_CMP_GT_F16',
'V_CMP_LG_F16',
'V_CMP_GE_F16',
'V_CMP_O_F16',
'V_CMPX_F_U32',
'V_CMPX_LT_U32',
'V_CMPX_EQ_U32',
'V_CMPX_LE_U32',
'V_CMPX_GT_U32',
'V_CMPX_NE_U32',
'V_CMPX_GE_U32',
'V_CMPX_T_U32',
'V_CMPX_F_F16',
'V_CMPX_LT_F16',
'V_CMPX_EQ_F16',
'V_CMPX_LE_F16',
'V_CMPX_GT_F16',
'V_CMPX_LG_F16',
'V_CMPX_GE_F16',
'V_CMPX_O_F16',
'V_CMP_F_U64',
'V_CMP_LT_U64',
'V_CMP_EQ_U64',
'V_CMP_LE_U64',
'V_CMP_GT_U64',
'V_CMP_NE_U64',
'V_CMP_GE_U64',
'V_CMP_T_U64',
'V_CMP_U_F16',
'V_CMP_NGE_F16',
'V_CMP_NLG_F16',
'V_CMP_NGT_F16',
'V_CMP_NLE_F16',
'V_CMP_NEQ_F16',
'V_CMP_NLT_F16',
'V_CMP_TRU_F16',
'V_CMPX_F_U64',
'V_CMPX_LT_U64',
'V_CMPX_EQ_U64',
'V_CMPX_LE_U64',
'V_CMPX_GT_U64',
'V_CMPX_NE_U64',
'V_CMPX_GE_U64',
'V_CMPX_T_U64',
'V_CMPX_U_F16',
'V_CMPX_NGE_F16',
'V_CMPX_NLG_F16',
'V_CMPX_NGT_F16',
'V_CMPX_NLE_F16',
'V_CMPX_NEQ_F16',
'V_CMPX_NLT_F16',
'V_CMPX_TRU_F16',
'BUFFER_LOAD_FORMAT_X',
'BUFFER_LOAD_FORMAT_XY',
'BUFFER_LOAD_FORMAT_XYZ',
'BUFFER_LOAD_FORMAT_XYZW',
'BUFFER_STORE_FORMAT_X',
'BUFFER_STORE_FORMAT_XY',
'BUFFER_STORE_FORMAT_XYZ',
'BUFFER_STORE_FORMAT_XYZW',
'BUFFER_LOAD_UBYTE',
'BUFFER_LOAD_SBYTE',
'BUFFER_LOAD_USHORT',
'BUFFER_LOAD_SSHORT',
'BUFFER_LOAD_DWORD',
'BUFFER_LOAD_DWORDX2',
'BUFFER_LOAD_DWORDX4',
'BUFFER_LOAD_DWORDX3',
'BUFFER_STORE_BYTE',
'BUFFER_STORE_SHORT',
'BUFFER_STORE_DWORD',
'BUFFER_STORE_DWORDX2',
'BUFFER_STORE_DWORDX4',
'BUFFER_STORE_DWORDX3',
'BUFFER_ATOMIC_SWAP',
'BUFFER_ATOMIC_CMPSWAP',
'BUFFER_ATOMIC_ADD',
'BUFFER_ATOMIC_SUB',
'BUFFER_ATOMIC_RSUB',
'BUFFER_ATOMIC_SMIN',
'BUFFER_ATOMIC_UMIN',
'BUFFER_ATOMIC_SMAX',
'BUFFER_ATOMIC_UMAX',
'BUFFER_ATOMIC_AND',
'BUFFER_ATOMIC_OR',
'BUFFER_ATOMIC_XOR',
'BUFFER_ATOMIC_INC',
'BUFFER_ATOMIC_DEC',
'BUFFER_ATOMIC_FCMPSWAP',
'BUFFER_ATOMIC_FMIN',
'BUFFER_ATOMIC_FMAX',
'BUFFER_ATOMIC_SWAP_X2',
'BUFFER_ATOMIC_CMPSWAP_X2',
'BUFFER_ATOMIC_ADD_X2',
'BUFFER_ATOMIC_SUB_X2',
'BUFFER_ATOMIC_RSUB_X2',
'BUFFER_ATOMIC_SMIN_X2',
'BUFFER_ATOMIC_UMIN_X2',
'BUFFER_ATOMIC_SMAX_X2',
'BUFFER_ATOMIC_UMAX_X2',
'BUFFER_ATOMIC_AND_X2',
'BUFFER_ATOMIC_OR_X2',
'BUFFER_ATOMIC_XOR_X2',
'BUFFER_ATOMIC_INC_X2',
'BUFFER_ATOMIC_DEC_X2',
'BUFFER_ATOMIC_FCMPSWAP_X2',
'BUFFER_ATOMIC_FMIN_X2',
'BUFFER_ATOMIC_FMAX_X2',
'BUFFER_WBINVL1_SC',
'BUFFER_WBINVL1_VOL',
'BUFFER_WBINVL1',
'TBUFFER_LOAD_FORMAT_X',
'TBUFFER_LOAD_FORMAT_XY',
'TBUFFER_LOAD_FORMAT_XYZ',
'TBUFFER_LOAD_FORMAT_XYZW',
'TBUFFER_STORE_FORMAT_X',
'TBUFFER_STORE_FORMAT_XY',
'TBUFFER_STORE_FORMAT_XYZ',
'TBUFFER_STORE_FORMAT_XYZW',
'IMAGE_LOAD',
'IMAGE_LOAD_MIP',
'IMAGE_LOAD_PCK',
'IMAGE_LOAD_PCK_SGN',
'IMAGE_LOAD_MIP_PCK',
'IMAGE_LOAD_MIP_PCK_SGN',
'IMAGE_STORE',
'IMAGE_STORE_MIP',
'IMAGE_STORE_PCK',
'IMAGE_STORE_MIP_PCK',
'IMAGE_GET_RESINFO',
'IMAGE_ATOMIC_SWAP',
'IMAGE_ATOMIC_CMPSWAP',
'IMAGE_ATOMIC_ADD',
'IMAGE_ATOMIC_SUB',
'IMAGE_ATOMIC_RSUB',
'IMAGE_ATOMIC_SMIN',
'IMAGE_ATOMIC_UMIN',
'IMAGE_ATOMIC_SMAX',
'IMAGE_ATOMIC_UMAX',
'IMAGE_ATOMIC_AND',
'IMAGE_ATOMIC_OR',
'IMAGE_ATOMIC_XOR',
'IMAGE_ATOMIC_INC',
'IMAGE_ATOMIC_DEC',
'IMAGE_ATOMIC_FCMPSWAP',
'IMAGE_ATOMIC_FMIN',
'IMAGE_ATOMIC_FMAX',
'IMAGE_SAMPLE',
'IMAGE_SAMPLE_CL',
'IMAGE_SAMPLE_D',
'IMAGE_SAMPLE_D_CL',
'IMAGE_SAMPLE_L',
'IMAGE_SAMPLE_B',
'IMAGE_SAMPLE_B_CL',
'IMAGE_SAMPLE_LZ',
'IMAGE_SAMPLE_C',
'IMAGE_SAMPLE_C_CL',
'IMAGE_SAMPLE_C_D',
'IMAGE_SAMPLE_C_D_CL',
'IMAGE_SAMPLE_C_L',
'IMAGE_SAMPLE_C_B',
'IMAGE_SAMPLE_C_B_CL',
'IMAGE_SAMPLE_C_LZ',
'IMAGE_SAMPLE_O',
'IMAGE_SAMPLE_CL_O',
'IMAGE_SAMPLE_D_O',
'IMAGE_SAMPLE_D_CL_O',
'IMAGE_SAMPLE_L_O',
'IMAGE_SAMPLE_B_O',
'IMAGE_SAMPLE_B_CL_O',
'IMAGE_SAMPLE_LZ_O',
'IMAGE_SAMPLE_C_O',
'IMAGE_SAMPLE_C_CL_O',
'IMAGE_SAMPLE_C_D_O',
'IMAGE_SAMPLE_C_D_CL_O',
'IMAGE_SAMPLE_C_L_O',
'IMAGE_SAMPLE_C_B_O',
'IMAGE_SAMPLE_C_B_CL_O',
'IMAGE_SAMPLE_C_LZ_O',
'IMAGE_GATHER4',
'IMAGE_GATHER4_CL',
'IMAGE_GATHER4_L',
'IMAGE_GATHER4_B',
'IMAGE_GATHER4_B_CL',
'IMAGE_GATHER4_LZ',
'IMAGE_GATHER4_C',
'IMAGE_GATHER4_C_CL',
'IMAGE_GATHER4_C_L',
'IMAGE_GATHER4_C_B',
'IMAGE_GATHER4_C_B_CL',
'IMAGE_GATHER4_C_LZ',
'IMAGE_GATHER4_O',
'IMAGE_GATHER4_CL_O',
'IMAGE_GATHER4_L_O',
'IMAGE_GATHER4_B_O',
'IMAGE_GATHER4_B_CL_O',
'IMAGE_GATHER4_LZ_O',
'IMAGE_GATHER4_C_O',
'IMAGE_GATHER4_C_CL_O',
'IMAGE_GATHER4_C_L_O',
'IMAGE_GATHER4_C_B_O',
'IMAGE_GATHER4_C_B_CL_O',
'IMAGE_GATHER4_C_LZ_O',
'IMAGE_GET_LOD',
'IMAGE_SAMPLE_CD',
'IMAGE_SAMPLE_CD_CL',
'IMAGE_SAMPLE_C_CD',
'IMAGE_SAMPLE_C_CD_CL',
'IMAGE_SAMPLE_CD_O',
'IMAGE_SAMPLE_CD_CL_O',
'IMAGE_SAMPLE_C_CD_O',
'IMAGE_SAMPLE_C_CD_CL_O',
'DS_ADD_U32',
'DS_SUB_U32',
'DS_RSUB_U32',
'DS_INC_U32',
'DS_DEC_U32',
'DS_MIN_I32',
'DS_MAX_I32',
'DS_MIN_U32',
'DS_MAX_U32',
'DS_AND_B32',
'DS_OR_B32',
'DS_XOR_B32',
'DS_MSKOR_B32',
'DS_WRITE_B32',
'DS_WRITE2_B32',
'DS_WRITE2ST64_B32',
'DS_CMPST_B32',
'DS_CMPST_F32',
'DS_MIN_F32',
'DS_MAX_F32',
'DS_NOP',
'DS_GWS_SEMA_RELEASE_ALL',
'DS_GWS_INIT',
'DS_GWS_SEMA_V',
'DS_GWS_SEMA_BR',
'DS_GWS_SEMA_P',
'DS_GWS_BARRIER',
'DS_WRITE_B8',
'DS_WRITE_B16',
'DS_ADD_RTN_U32',
'DS_SUB_RTN_U32',
'DS_RSUB_RTN_U32',
'DS_INC_RTN_U32',
'DS_DEC_RTN_U32',
'DS_MIN_RTN_I32',
'DS_MAX_RTN_I32',
'DS_MIN_RTN_U32',
'DS_MAX_RTN_U32',
'DS_AND_RTN_B32',
'DS_OR_RTN_B32',
'DS_XOR_RTN_B32',
'DS_MSKOR_RTN_B32',
'DS_WRXCHG_RTN_B32',
'DS_WRXCHG2_RTN_B32',
'DS_WRXCHG2ST64_RTN_B32',
'DS_CMPST_RTN_B32',
'DS_CMPST_RTN_F32',
'DS_MIN_RTN_F32',
'DS_MAX_RTN_F32',
'DS_WRAP_RTN_B32',
'DS_SWIZZLE_B32',
'DS_READ_B32',
'DS_READ2_B32',
'DS_READ2ST64_B32',
'DS_READ_I8',
'DS_READ_U8',
'DS_READ_I16',
'DS_READ_U16',
'DS_CONSUME',
'DS_APPEND',
'DS_ORDERED_COUNT',
'DS_ADD_U64',
'DS_SUB_U64',
'DS_RSUB_U64',
'DS_INC_U64',
'DS_DEC_U64',
'DS_MIN_I64',
'DS_MAX_I64',
'DS_MIN_U64',
'DS_MAX_U64',
'DS_AND_B64',
'DS_OR_B64',
'DS_XOR_B64',
'DS_MSKOR_B64',
'DS_WRITE_B64',
'DS_WRITE2_B64',
'DS_WRITE2ST64_B64',
'DS_CMPST_B64',
'DS_CMPST_F64',
'DS_MIN_F64',
'DS_MAX_F64',
'DS_ADD_RTN_U64',
'DS_SUB_RTN_U64',
'DS_RSUB_RTN_U64',
'DS_INC_RTN_U64',
'DS_DEC_RTN_U64',
'DS_MIN_RTN_I64',
'DS_MAX_RTN_I64',
'DS_MIN_RTN_U64',
'DS_MAX_RTN_U64',
'DS_AND_RTN_B64',
'DS_OR_RTN_B64',
'DS_XOR_RTN_B64',
'DS_MSKOR_RTN_B64',
'DS_WRXCHG_RTN_B64',
'DS_WRXCHG2_RTN_B64',
'DS_WRXCHG2ST64_RTN_B64',
'DS_CMPST_RTN_B64',
'DS_CMPST_RTN_F64',
'DS_MIN_RTN_F64',
'DS_MAX_RTN_F64',
'DS_READ_B64',
'DS_READ2_B64',
'DS_READ2ST64_B64',
'DS_CONDXCHG32_RTN_B64',
'DS_ADD_SRC2_U32',
'DS_SUB_SRC2_U32',
'DS_RSUB_SRC2_U32',
'DS_INC_SRC2_U32',
'DS_DEC_SRC2_U32',
'DS_MIN_SRC2_I32',
'DS_MAX_SRC2_I32',
'DS_MIN_SRC2_U32',
'DS_MAX_SRC2_U32',
'DS_AND_SRC2_B32',
'DS_OR_SRC2_B32',
'DS_XOR_SRC2_B32',
'DS_WRITE_SRC2_B32',
'DS_MIN_SRC2_F32',
'DS_MAX_SRC2_F32',
'DS_ADD_SRC2_U64',
'DS_SUB_SRC2_U64',
'DS_RSUB_SRC2_U64',
'DS_INC_SRC2_U64',
'DS_DEC_SRC2_U64',
'DS_MIN_SRC2_I64',
'DS_MAX_SRC2_I64',
'DS_MIN_SRC2_U64',
'DS_MAX_SRC2_U64',
'DS_AND_SRC2_B64',
'DS_OR_SRC2_B64',
'DS_XOR_SRC2_B64',
'DS_WRITE_SRC2_B64',
'DS_MIN_SRC2_F64',
'DS_MAX_SRC2_F64',
'DS_WRITE_B96',
'DS_WRITE_B128',
'DS_CONDXCHG32_RTN_B128',
'DS_READ_B96',
'DS_READ_B128',
'S_LOAD_DWORD',
'S_LOAD_DWORDX2',
'S_LOAD_DWORDX4',
'S_LOAD_DWORDX8',
'S_LOAD_DWORDX16',
'S_BUFFER_LOAD_DWORD',
'S_BUFFER_LOAD_DWORDX2',
'S_BUFFER_LOAD_DWORDX4',
'S_BUFFER_LOAD_DWORDX8',
'S_BUFFER_LOAD_DWORDX16',
'S_DCACHE_INV_VOL',
'S_MEMTIME',
'S_DCACHE_INV',
'V_INTERP_P1_F32',
'V_INTERP_P2_F32',
'V_INTERP_MOV_F32'
]

def GenerateInsClassPairs(doc_filename):
    src = open(doc_filename, encoding='utf8')

    pair_list = []

    lines = src.readlines()
    cur_class = ''
    for line in lines:

        if line == '\n':
            continue
        line = line.strip()

        # Get current class name
        for section_name in InsClassMap.keys():
            if section_name in line:
                cur_class = InsClassMap[section_name]
                break

        for ins_name in InsList:

            match_name = ins_name
            # fix V3_ prefix
            if match_name[:3] == 'V3_':
                match_name = match_name.replace('V3_', 'V_')

            match_name = match_name.lower()
            if match_name in line:
                print('{} - {}'.format(ins_name, cur_class))
                pair_list.append((ins_name, cur_class))
    src.close()
    return pair_list

def FixLine(ins_pairs, old_line):
    new_line = old_line

    for ins_name, ins_cls in ins_pairs:
        if not ins_name in old_line:
            continue

        new_line = old_line.replace('InstructionClassUnknown', ins_cls)
        break
    return new_line

def FixInsClass(src_filename, ins_pairs):
    src = open(src_filename)
    dst = open(src_filename + '.fix.cpp', 'w')

    for line in src.readlines():
        new_line = FixLine(ins_pairs, line)
        dst.write(new_line)

    dst.close()
    src.close()

def main():
    ins_pair_list = GenerateInsClassPairs('GPU_Shader_Core_ISA_e.txt')
    FixInsClass('GCNInstructionDefs.cpp', ins_pair_list)
    pass

if __name__ == '__main__':
    main()